<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../static/js/echarts.min.js"></script>
</head>
<body>

<div id="main" style="width:1920px;height:1080px"></div>

<script>
    var getID = echarts.init(document.getElementById("main"));



    var item = {{ item.item | tojson }};
{#    {% set a = {"周": [i[0] for i in datas]} %}#}
    var a = {"周":[ {% for i in item.datas %} "{{ i[0] }}", {% endfor %} ] }
    console.log(a);

    option = {
    title: {
        text: '折线图堆叠'
    },
    tooltip: {
        trigger: 'axis'
    },
    legend: {
        data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
    },
    grid: {
        left: '3%',
        right: '4%',
        bottom: '3%',
        containLabel: true
    },
    toolbox: {
        feature: {
            saveAsImage: {}
        }
    },
    xAxis: {
        type: 'category',
        boundaryGap: false,
        data: a.周
    },
    yAxis: {
        type: 'value'
    },
    series: [
        {
            name: '邮件营销',
            type: 'line',
            stack: '总量',
            data: item.邮件营销
        },
        {
            name: '联盟广告',
            type: 'line',
            stack: '总量',
            data: item.联盟广告
        },
        {
            name: '视频广告',
            type: 'line',
            stack: '总量',
            data: item.视频广告
        },
        {
            name: '直接访问',
            type: 'line',
            stack: '总量',
            data: item.直接访问
        },
        {
            name: '搜索引擎',
            type: 'line',
            stack: '总量',
            data: item.搜索引擎
        }
    ]
};

    getID.setOption(option)
</script>
</body>
</html>